package com.hyt.it.ogt.ykcj.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 考试形式枚举
 *
 * @author admin
 */
public enum ExamFormEnums {
  FORM_EXAM(0, "考试"),
  FORM_EXAM_GROUP(1, "考试组"),
  ;

  private Integer code;

  private String desc;

  ExamFormEnums(Integer code, String desc) {
    this.code = code;
    this.desc = desc;
  }

  public Integer getCode() {
    return code;
  }

  public String getDesc() {
    return desc;
  }

  public static final Map<Integer,String> map = new HashMap<>();

  static{
    for(ExamFormEnums examFormEnums : ExamFormEnums.values()){
      map.put(examFormEnums.getCode(), examFormEnums.getDesc());
    }
  }

  public static ExamFormEnums getDescByCode(Integer code) {
    for (ExamFormEnums examGroupEnum : ExamFormEnums.values()) {
      if (examGroupEnum.getCode().equals(code)) {
        return examGroupEnum;
      }
    }
    return null;
  }
}
